package com.chexiehui.jc.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.blankj.utilcode.util.AppUtils;
import com.chexiehui.jc.Constants;
import com.chexiehui.jc.R;
import com.chexiehui.jc.base.BaseActivity;
import com.chexiehui.jc.utils.BundleBuilder;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 关于
 */
public class AboutActivity extends BaseActivity {
    @BindView(R.id.tv_version)
    TextView tvVersion;
    @BindView(R.id.rl_version_container)
    RelativeLayout rlVersionContainer;
    @BindView(R.id.rl_yhxy_container)
    RelativeLayout rlYhxyContainer;
    @BindView(R.id.rl_yszc_container)
    RelativeLayout rlYszcContainer;
    @BindView(R.id.rl_grxxbhtk_container)
    RelativeLayout rlGrxxbhtkContainer;
    @BindView(R.id.rl_yhzcxy_container)
    RelativeLayout rlYhzcxyContainer;
    @BindView(R.id.refreshLayout)
    SmartRefreshLayout mRefreshLayout;

    @Override
    protected void setTitleBar() {
        titleBar.setTitleMainText("关于车协汇");
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_about;
    }

    @Override
    protected void initView(Bundle var1) {
        mRefreshLayout.setEnableRefresh(false);
        mRefreshLayout.setEnableLoadMore(false);
        mRefreshLayout.setEnableOverScrollDrag(true);
        mRefreshLayout.setDragRate(0.5f);
        mRefreshLayout.setEnableOverScrollDrag(true);
        tvVersion.setText("V" + AppUtils.getAppVersionName());
    }

    @OnClick({R.id.rl_version_container, R.id.rl_yhxy_container, R.id.rl_yszc_container,
            R.id.rl_grxxbhtk_container, R.id.rl_yhzcxy_container})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.rl_version_container:
                break;
            case R.id.rl_yhxy_container:
                startActivity(WebActivity.class, new BundleBuilder().putString("url", Constants.YRL_CYHYHXY).create());
                break;
            case R.id.rl_yszc_container:
                startActivity(WebActivity.class, new BundleBuilder().putString("url", Constants.YRL_CYHYSZC).create());
                break;
            case R.id.rl_grxxbhtk_container:
                startActivity(WebActivity.class, new BundleBuilder().putString("url", Constants.YRL_CYHGRXXBHTK).create());
                break;
            case R.id.rl_yhzcxy_container:
                startActivity(WebActivity.class, new BundleBuilder().putString("url", Constants.YRL_CYHZCXY).create());
                break;
        }
    }
}
